<template>
  <div class="app">
    <merchantHeader />
    <div class="back">
      <div class="con">
        <div class="pxes"></div>
        <div class="listneo">
          <businessL />
          <div class="conres">
            <div class="ra"><h3>新活动申请</h3></div>
            <el-tabs v-model="activityType" @tab-click="handleClick">
              <el-tab-pane label="免费体验活动" name="1">
                <h4>活动内容填写</h4>
                <el-form label-width="100px" class="demo-ruleForm">
                  <el-form-item label="产品名称">
                    <el-input v-model="ones.productName"></el-input>
                  </el-form-item>
                  <el-form-item label="商品分类">
                    <el-input v-model="ones.categoryId" style="width: 200px;"></el-input>
                  </el-form-item>
                  <el-form-item label="市场参考价:">
                    <el-input v-model="ones.marketPrice" style="width: 200px;"></el-input>
                  </el-form-item>
                  <el-form-item label="提供体验数量">
                    <el-input v-model="ones.productNum" style="width: 200px;"></el-input>
                  </el-form-item>
                  <el-form-item label="规格:">
                    <el-row v-for="(tags, tagsIndex) in tagArrayone" :key="tagsIndex">
                      <el-col :span="3">
                        <el-input v-model="tags.guig" size="medium"></el-input>
                      </el-col>
                      <el-col :offset="1" :span="20">
                        <el-tag
                          :key="tagones"
                          v-for="tagones in tags.dynamicTags.tagone"
                          closable
                          :disable-transitions="false"
                          @close="handleCloseone(tagones, tagsIndex)"
                        >{{tagones}}</el-tag>
                        <el-input
                          class="input-new-tag"
                          v-if="tags.inputVisible"
                          v-model="tags.inputValue"
                          :ref="`saveTagInputone`"
                          size="small"
                          @keyup.enter.native="handleInputConfirmone(tagsIndex)"
                          @blur="handleInputConfirmone(tagsIndex)"
                        ></el-input>
                        <el-button
                          v-else
                          class="button-new-tag"
                          size="small"
                          @click="showInputone(tagsIndex)"
                        >+内容</el-button>
                        <el-button size="small" @click="deletetagone(tagsIndex)">删除本行</el-button>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-button @click="addtagone()" type="primary" size="small">添加</el-button>
                    </el-row>
                  </el-form-item>
                  <el-form-item label="活动时间" required>
                    <el-col :span="11">
                      <el-form-item prop="date1">
                        <el-date-picker
                          v-model="onedate"
                          value-format="yyyy-MM-dd HH:mm:00"
                          format="yyyy-MM-dd HH:mm:00"
                          type="datetimerange"
                          range-separator="至"
                          start-placeholder="开始日期"
                          end-placeholder="结束日期"
                        ></el-date-picker>
                      </el-form-item>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="申请条件:">
                    <el-row>
                      <el-col :span="10">
                        <span style="margin-left: 60px;margin-right: 8px;">地区</span>
                        <el-input
                          v-model="ones.applyCondition.province"
                          size="small"
                          style="width:50px"
                        ></el-input>
                        <span>省</span>
                        <el-input
                          v-model="ones.applyCondition.city"
                          size="small"
                          style="width:50px"
                        ></el-input>
                        <span>市</span>
                      </el-col>
                      <el-col :span="10">
                        <el-form-item size="small" label="年龄">
                          <el-select v-model="ones.applyCondition.age">
                            <el-option label="18" value="18"></el-option>
                            <el-option label="20" value="20"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="10">
                        <el-form-item size="small" label="职业">
                          <el-select v-model="ones.applyCondition.occupation">
                            <el-option label="医生" value="医生"></el-option>
                            <el-option label="老师" value="老师"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="10">
                        <el-form-item size="small" label="性别">
                          <el-select v-model="ones.applyCondition.sex" placeholder="性别">
                            <el-option label="男" value="男"></el-option>
                            <el-option label="女" value="女"></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </el-form-item>

                  <el-form-item label="产品展示图:">
                    <el-upload
                      action="http://47.105.66.232:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess"
                      :on-remove="onRemoveTxt"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="onedialogVisible_z">
                      <img width="100%" :src="onedialogImageUrl_z" alt />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item label="产品详情图:">
                    <el-upload
                      action="http://47.105.66.232:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_1x"
                      :on-remove="onRemoveTxt_1x"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="onedialogVisible_x">
                      <img width="100%" :src="onedialogVisible_x" alt />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" @click="ljcj()">立即创建</el-button>
                    <el-button @click="resetForm()">重置</el-button>
                  </el-form-item>
                </el-form>
              </el-tab-pane>
              <el-tab-pane label="价格竞猜活动" name="2">
                <h4>活动内容填写</h4>
                <el-form label-width="120px" class="demo-ruleForm">
                  <el-form-item label="产品名称">
                    <el-input v-model="twos.productName"></el-input>
                  </el-form-item>
                  <el-form-item label="奖品名称">
                    <el-input v-model="twos.prizeName"></el-input>
                  </el-form-item>
                  <el-form-item label="商品分类">
                    <el-select v-model="twos.categoryId">
                      <el-option label="衣服" value="衣服"></el-option>
                      <el-option label="鞋子" value="鞋子"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="提供奖品数量">
                    <el-input v-model="twos.productNum" style="width: 200px;"></el-input>
                  </el-form-item>
                  <el-form-item label="活动时间">
                    <el-col :span="11">
                      <el-date-picker
                        v-model="twosdate"
                        value-format="yyyy-MM-dd HH:mm:00"
                        format="yyyy-MM-dd HH:mm:00"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                      ></el-date-picker>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="竞猜方式:">
                    <el-row>
                      <el-radio v-model="twos.guessType" label="0">全价格区间</el-radio>
                    </el-row>
                    <el-row>
                      <el-col :span="8">
                        <el-radio v-model="twos.guessType" label="1">固定价格区间</el-radio>
                      </el-col>
                      <el-col :span="3">
                        <el-input :disabled="twos.guessType!=1" v-model="twos_1" size="medium"></el-input>
                      </el-col>
                      <el-col :span="1">元-</el-col>
                      <el-col :span="3">
                        <el-input :disabled="twos.guessType!=1" v-model="twos_2" size="medium"></el-input>
                      </el-col>元
                    </el-row>
                    <el-row>
                      <el-col :span="8">
                        <el-radio v-model="twos.guessType" label="2">趣味竞猜</el-radio>
                      </el-col>
                      <el-col :span="16">
                        <el-input
                          size="mini"
                          :disabled="twos.guessType!=2"
                          maxlength="1"
                          style="width:40px"
                          v-model="twos_a"
                        ></el-input>
                        <el-input
                          size="mini"
                          :disabled="twos.guessType!=2"
                          maxlength="1"
                          style="width:40px"
                          v-model="twos_b"
                        ></el-input>
                        <el-input
                          size="mini"
                          :disabled="twos.guessType!=2"
                          maxlength="1"
                          style="width:40px"
                          v-model="twos_c"
                        ></el-input>
                        <el-input
                          size="mini"
                          :disabled="twos.guessType!=2"
                          maxlength="1"
                          style="width:40px"
                          v-model="twos_d"
                        ></el-input>
                        <el-input
                          size="mini"
                          :disabled="twos.guessType!=2"
                          maxlength="1"
                          style="width:40px"
                          v-model="twos_e"
                        ></el-input>.
                        <el-input
                          size="mini"
                          :disabled="twos.guessType!=2"
                          maxlength="1"
                          style="width:40px"
                          v-model="twos_f"
                        ></el-input>
                        <el-input
                          size="mini"
                          :disabled="twos.guessType!=2"
                          maxlength="1"
                          style="width:40px"
                          v-model="twos_g"
                        ></el-input>
                      </el-col>
                    </el-row>
                  </el-form-item>
                  <el-form-item label="产品展示图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_2z"
                      :on-remove="onRemoveTxt_2z"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="twosdialogVisible_z">
                      <img width="100%" :src="twosdialogImageUrl_z" alt />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item label="奖品详情图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_2j"
                      :on-remove="onRemoveTxt_2j"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="twosdialogVisible_x">
                      <img width="100%" :src="twosdialogImageUrl_x" alt />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item label="产品详情图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_2x"
                      :on-remove="onRemoveTxt_2z"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="twosdialogVisible_c">
                      <img width="100%" :src="twosdialogImageUrl_c" alt />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" @click="twostj()">提交审核</el-button>
                  </el-form-item>
                </el-form>
              </el-tab-pane>
              <el-tab-pane label="新品首发活动" name="3">
                <h4>活动内容填写</h4>
                <el-form label-width="100px" class="demo-ruleForm">
                  <el-form-item label="产品名称">
                    <el-input v-model="threes.productName"></el-input>
                  </el-form-item>
                  <el-form-item label="产品分类">
                    <el-select v-model="threes.categoryId">
                      <el-option label="衣服" value="衣服"></el-option>
                      <el-option label="珠宝" value="珠宝"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="产品价格">
                    <el-input v-model="threes.productPrice" style="width: 200px;"></el-input>
                  </el-form-item>
                  <el-form-item label="预定金方式">
                    <el-select v-model="threes.reserveType">
                      <el-option label="全款预定" value="0"></el-option>
                      <el-option label="预定金预定" value="1"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="预定金金额:">
                    <el-input v-model="threes.reservePrice" style="width: 200px;"></el-input>
                  </el-form-item>
                  <el-row>
                    <el-col :span="10">
                      <el-form-item label="优惠方式">
                        <el-select v-model="threes.discountType">
                          <el-option label="预定立减" value="0"></el-option>
                          <el-option label="尾款抵扣" value="1"></el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                    <el-col :span="10" v-if="threes.discountType!=''">
                      <el-form-item :label="threes.discountType==0 ? '预定立减￥':'尾款抵扣￥'">
                        <el-input v-model="threes.discountPrice" style="width: 200px;"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-form-item label="预定时间">
                    <el-col :span="11">
                      <el-date-picker
                        v-model="threesdate"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        format="yyyy-MM-dd HH:mm:ss"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                      ></el-date-picker>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="尾款支付时间">
                    <el-col :span="11">
                      <el-date-picker
                        v-model="threesdate_z"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        format="yyyy-MM-dd HH:mm:ss"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                      ></el-date-picker>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="发货时间" prop="region">
                    <el-select v-model="threes.deliveryTime">
                      <el-option label="3天内发货" value="1"></el-option>
                      <el-option label="7天内发货" value="2"></el-option>
                      <el-option label="15天内发货" value="3"></el-option>
                      <el-option label="30天内发货" value="4"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="选择">
                    <el-row v-for="(tags, tagsIndex) in tagArray" :key="tagsIndex">
                      <el-col :span="3">
                        <el-input placeholder="名称" v-model="tags.guig" size="medium"></el-input>
                      </el-col>
                      <el-col :offset="1" :span="20">
                        <el-tag
                          :key="tag1"
                          v-for="tag1 in tags.dynamicTags.tag"
                          closable
                          :disable-transitions="false"
                          @close="handleClose(tag1, tagsIndex)"
                        >{{tag1}}</el-tag>
                        <el-input
                          class="input-new-tag"
                          v-if="tags.inputVisible"
                          v-model="tags.inputValue"
                          :ref="`saveTagInput`"
                          size="small"
                          @keyup.enter.native="handleInputConfirm3(tagsIndex)"
                          @blur="handleInputConfirm3(tagsIndex)"
                        ></el-input>
                        <el-button
                          v-else
                          class="button-new-tag"
                          size="small"
                          @click="showInput3(tagsIndex)"
                        >+规格</el-button>
                        <el-button size="small" @click="deletetag3(tagsIndex)">删除本行</el-button>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-button @click="addtag3()" type="primary" size="small">添加</el-button>
                    </el-row>
                  </el-form-item>
                  <el-form-item label="保障:">
                    <el-checkbox true-label="1" false-label="0" v-model="threes.freeShipping">包邮</el-checkbox>
                    <el-checkbox true-label="1" false-label="0" v-model="threes.sevenReturn">七天无理由</el-checkbox>
                    <el-checkbox
                      true-label="1"
                      false-label="0"
                      v-model="threes.freeShipping"
                    >15天无理由退货</el-checkbox>
                    <el-checkbox true-label="1" false-label="0" v-model="threes.fake">不支持七天无理由退货</el-checkbox>
                  </el-form-item>
                  <el-form-item label="产品参数">
                    <div v-for="(ite,i) in threes.productParams" :key="i">
                      <el-row>
                        <el-col :span="15">
                          <el-form-item label="参数名称">
                            <el-input
                              size="small"
                              placeholder="请输入参数名称,如品牌"
                              v-model="threes.productParams[i].paramKey"
                            ></el-input>
                          </el-form-item>
                        </el-col>
                        <el-col :span="5">
                          <el-button size="small" @click="deleteParameter(i)">删除</el-button>
                        </el-col>
                      </el-row>
                      <el-row>
                        <el-col :span="15">
                          <el-form-item label="内容">
                            <el-input
                              size="small"
                              placeholder="请输入内容,如香奈儿"
                              v-model="threes.productParams[i].paramValue"
                            ></el-input>
                          </el-form-item>
                        </el-col>
                      </el-row>
                    </div>
                    <el-row>
                      <el-button size="mini" type="danger" @click="threesadds()">添加参数</el-button>
                    </el-row>
                  </el-form-item>

                  <el-form-item label="产品展示图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_3z"
                      :on-remove="onRemoveTxt_3z"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="dialogVisible3_z">
                      <img width="100%" :src="dialogImageUrl3_z" />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item label="产品详情图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_3x"
                      :on-remove="onRemoveTxt_3x"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="dialogVisible3_x">
                      <img width="100%" :src="dialogImageUrl3_x" />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" @click="threestj()">提交审核</el-button>
                  </el-form-item>
                </el-form>
              </el-tab-pane>
              <el-tab-pane label="本地体验活动" name="4">
                <h4>活动内容填写</h4>
                <el-form label-width="100px" class="demo-ruleForm">
                  <el-form-item label="活动标题:">
                    <el-input v-model="four.productName"></el-input>
                  </el-form-item>
                  <el-form-item label="服务类型:">
                    <el-select v-model="four.types">
                      <el-option label="餐饮服务" value="餐饮服务"></el-option>
                      <el-option label="酒店旅游服务" value="酒店旅游服务"></el-option>
                      <el-option label="美容美体服务" value="美容美体服务"></el-option>
                      <el-option label="其他服务" value="其他服务"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="服务提供地址:">
                    <el-input v-model="four.address" style="width: 200px;"></el-input>
                  </el-form-item>
                  <el-form-item label="优惠类型:">
                    <el-select @change="fourtypes" v-model="four.genre" style="width: 200px;">
                      <el-option label="免费" value="1"></el-option>
                      <el-option label="折扣" value="2"></el-option>
                      <el-option label="代金券" value="3"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="优惠数量:">
                    <el-input v-model="four.nums" style="width: 200px;"></el-input>份
                  </el-form-item>
                  <el-form-item label="活动时间:" required>
                    <el-col :span="11">
                      <el-form-item>
                        <el-date-picker
                          v-model="fourdate"
                          value-format="yyyy-MM-dd HH:mm:00"
                          format="yyyy-MM-dd HH:mm:00"
                          type="datetimerange"
                          range-separator="至"
                          start-placeholder="开始日期"
                          end-placeholder="结束日期"
                        ></el-date-picker>
                      </el-form-item>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="可用期限" required>
                    <el-col :span="11">
                      <el-form-item>
                        <el-date-picker
                          v-model="fourdate2"
                          value-format="yyyy-MM-dd HH:mm:00"
                          format="yyyy-MM-dd HH:mm:00"
                          type="datetimerange"
                          range-separator="至"
                          start-placeholder="开始日期"
                          end-placeholder="结束日期"
                        ></el-date-picker>
                      </el-form-item>
                    </el-col>
                  </el-form-item>
                  <el-form-item :label="four.genre==2 ? '折扣:':'店面价格'">
                    <el-input v-model="four.money" style="width: 200px;"></el-input>元
                  </el-form-item>
                  <el-form-item label="支付方式:" v-if="four.genre!=1">
                    <el-radio v-model="four.mode" v-if="four.genre!=3" label="1">积分</el-radio>
                    <el-radio v-model="four.mode" v-if="four.genre!=2" label="2">现金</el-radio>
                  </el-form-item>
                  <el-form-item label="支付金额:" v-if="four.genre!=1">
                    <el-input v-model="four.sum" style="width: 200px;"></el-input>
                    <span>{{four.mode==1 ? '积分':'元'}}</span>
                  </el-form-item>
                  <el-form-item style="display:flex;margin-bottom: 5px;">
                    <el-button @click="fourText(1)" size="mini">点评要求</el-button>
                    <el-button @click="fourText(2)" size="mini">分享要求</el-button>
                    <el-button @click="fourText(3)" size="mini">规则说明</el-button>
                    <el-button @click="fourText(4)" size="mini">套餐介绍</el-button>
                    <el-button @click="fourText(5)" size="mini">门店信息</el-button>
                  </el-form-item>
                  <el-form-item label="服务包含类容:">
                    <div class="fourContent">
                      <el-input
                        size="mini"
                        style="display:block"
                        v-focus
                        autosize
                        type="textarea"
                        v-if="fourBol1"
                        v-model="fourtext1"
                        @blur="shiqu4(1)"
                      ></el-input>
                      <el-input
                        size="mini"
                        style="display:block"
                        v-focus
                        autosize
                        type="textarea"
                        v-if="fourBol2"
                        v-model="fourtext2"
                        @blur="shiqu4(2)"
                      ></el-input>

                      <el-input
                        size="mini"
                        style="display:block"
                        v-focus
                        autosize
                        type="textarea"
                        v-if="fourBol3"
                        v-model="fourtext3"
                        @blur="shiqu4(3)"
                      ></el-input>

                      <el-input
                        size="mini"
                        style="display:block"
                        v-focus
                        autosize
                        type="textarea"
                        v-if="fourBol4"
                        v-model="fourtext4"
                        @blur="shiqu4(4)"
                      ></el-input>

                      <el-input
                        size="mini"
                        style="display:block"
                       v-focus
                        autosize
                        type="textarea"
                        v-if="fourBol5"
                        v-model="fourtext5"
                        @blur="shiqu4(5)"
                      ></el-input>
                    </div>
                  </el-form-item>
                  <el-form-item label="主图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess"
                      :on-remove="onRemoveTxt"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="onedialogVisible_z">
                      <img width="100%" :src="onedialogImageUrl_z" alt />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item label="服务详情图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_1x"
                      :on-remove="onRemoveTxt_1x"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="onedialogVisible_x">
                      <img width="100%" :src="onedialogVisible_x" alt />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" @click="ljcj()">提交审核</el-button>
                  </el-form-item>
                </el-form>
              </el-tab-pane>
              <el-tab-pane label="积分兑换" name="5">
                <h4>活动内容填写</h4>
                <el-form label-width="100px" class="demo-ruleForm">
                  <el-form-item label="产品名称">
                    <el-input v-model="five.productName"></el-input>
                  </el-form-item>
                  <el-form-item label="产品分类">
                    <el-select v-model="five.categoryId">
                      <el-option label="衣服" value="衣服"></el-option>
                      <el-option label="珠宝" value="珠宝"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="产品价格">
                    <el-input v-model="five.productPrice" style="width: 200px;"></el-input>元
                  </el-form-item>
                  <el-form-item label="兑换积分">
                    <el-input v-model="five.integral" style="width: 200px;"></el-input>积分
                  </el-form-item>
                  <el-form-item label="活动时间">
                    <el-col :span="11">
                      <el-date-picker
                        v-model="fivedate"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        format="yyyy-MM-dd HH:mm:ss"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                      ></el-date-picker>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="提供数量">
                    <el-input v-model="five.nums" style="width: 200px;"></el-input>积分
                  </el-form-item>
                  <el-form-item label="可使用时间" v-if="abs!=1">
                    <el-col :span="11">
                      <el-date-picker
                        v-model="fivedate2"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        format="yyyy-MM-dd HH:mm:ss"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                      ></el-date-picker>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="发货时间" prop="region" v-if="abs==1">
                    <el-select v-model="five.deliveryTime">
                      <el-option label="3天内发货" value="1"></el-option>
                      <el-option label="7天内发货" value="2"></el-option>
                      <el-option label="15天内发货" value="3"></el-option>
                      <el-option label="30天内发货" value="4"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="保障:">
                    <el-checkbox true-label="1" false-label="0" v-model="five.freeShipping">包邮</el-checkbox>
                    <el-checkbox true-label="1" false-label="0" v-model="five.sevenReturn">七天无理由</el-checkbox>
                    <el-checkbox true-label="1" false-label="0" v-model="five.freeShipping">15天无理由退货</el-checkbox>
                    <el-checkbox true-label="1" false-label="0" v-model="five.fake">不支持七天无理由退货</el-checkbox>
                  </el-form-item>
                  <el-form-item label="产品参数">
                    <div v-for="(ite,i) in five.productParams" :key="i">
                      <el-row>
                        <el-col :span="15">
                          <el-form-item label="参数名称">
                            <el-input
                              size="small"
                              placeholder="请输入参数名称,如品牌"
                              v-model="five.productParams[i].paramKey"
                            ></el-input>
                          </el-form-item>
                        </el-col>
                        <el-col :span="5">
                          <el-button size="small" @click="deleteParameter5(i)">删除</el-button>
                        </el-col>
                      </el-row>
                      <el-row>
                        <el-col :span="15">
                          <el-form-item label="内容">
                            <el-input
                              size="small"
                              placeholder="请输入内容,如香奈儿"
                              v-model="five.productParams[i].paramValue"
                            ></el-input>
                          </el-form-item>
                        </el-col>
                      </el-row>
                    </div>
                    <el-row>
                      <el-button size="mini" type="danger" @click="fivesadds()">添加参数</el-button>
                    </el-row>
                  </el-form-item>

                  <el-form-item label="产品展示图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_3z"
                      :on-remove="onRemoveTxt_3z"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="dialogVisible3_z">
                      <img width="100%" :src="dialogImageUrl3_z" />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item label="产品详情图:">
                    <el-upload
                      action="http://192.168.1.13:10001/api/common/oss/upload"
                      multiple
                      :limit="5"
                      list-type="picture-card"
                      :on-exceed="handleExceed"
                      :on-error="uploadError"
                      :on-success="uploadSuccess_3x"
                      :on-remove="onRemoveTxt_3x"
                      ref="upload"
                    >
                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="dialogVisible3_x">
                      <img width="100%" :src="dialogImageUrl3_x" />
                    </el-dialog>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" @click="threestj()">提交审核</el-button>
                  </el-form-item>
                </el-form>
              </el-tab-pane>
            </el-tabs>
          </div>
        </div>
      </div>
    </div>
    <Footer />
  </div>
</template>
<script>
import merchantHeader from "@/components/merchantHeader";
import Footer from "@/components/Footer";
import businessL from "@/components/businessL";
import { create_activity } from "@/apiUrl/busslogin";
export default {
  components: {
    merchantHeader,
    Footer,
    businessL
  },
  directives:{
    focus:{
      inserted: function(el) {
        console.log(el)
        el.children[0].focus();
      }
    }
  },
  data() {
    return {
      businessId:this.$store.getters.businessId,
      files: [],
      files1: [],
      files2: [],
      files3: [],
      files4: [],
      files5: [],
      files6: [],
      aa: [{ ab: "", ac: "" }],
      //全局
      // 新品首发活动那的优惠方式
      discounts: "",
      activityType: "1",
      //第一块
      ones: {
        businessId:null,
        activityType: "",
        productName: "", //商品名称
        categoryId: "", //商品分类
        marketPrice: "", //市场指导价
        productNum: "", //提供体验数量
        startTime: "", //活动开始时间  （必填）
        endTime: "", //活动结束时间  （必填），
        attrjson: [], //规格参数
        productImage: "", //产品图（必填）
        detailImage: "", //产品详情图 多个用英文逗号隔开 （必填）
        applyCondition: {
          //申请条件
          province: "",
          city: "",
          sex: "",
          age: "", //年龄
          occupation: "" //职业
        }
      },
      // 时间
      onedate: ["2020-06-17 00:00", "2020-07-16 00:00"],
      //tag键
      tagArrayone: [
        {
          dynamicTags: {
            tagone: []
          },
          guig: "",
          inputVisible: false,
          currentIndex: -1,
          inputValue: ""
        }
      ],
      //上传产品展示图
      onedialogImageUrl_z: "",
      onedialogVisible_z: false,
      //上传产品详情图
      onedialogImageUrl_x: "",
      onedialogVisible_x: false,

      //第二块
      twos: {
        activityType: "",
        productName: "", //商品名称
        categoryId: "", //商品分类
        productNum: "", //提供体验数量
        startTime: "", //活动开始时间  （必填）
        endTime: "", //活动结束时间  （必填）
        guessType: "", //竞猜方式 （竞猜方式 0:全区间价格 1:固定区间价格 2:趣味竞猜）
        guessValue: "", //竞猜值
        productImage: "", //产品图（必填）
        detailImage: "", //产品详情图 多个用英文逗号隔开 （必填）
        prizeImage: "", //奖品图片 多个用英文逗号隔开 （必填）
        prizeName: ""
      },
      //时间
      twosdate: ["2020-06-17 00:00", "2020-07-16 00:00"],
      //固定价格区间
      twos_1: "",
      twos_2: "",
      //趣味竞猜
      twos_a: "",
      twos_b: "",
      twos_c: "",
      twos_d: "",
      twos_e: "",
      twos_f: "",
      twos_g: "",
      //上传产品展示图
      twosdialogImageUrl_z: "",
      twosdialogVisible_z: false,
      //上传奖品详情图
      twosdialogImageUrl_x: "",
      twosdialogVisible_x: false,
      // 上传产品详情图
      twosdialogImageUrl_c: "",
      twosdialogVisible_c: false,

      // 第三块
      threes: {
        activityType: "",
        productName: "", //商品名称
        categoryId: "", //商品分类
        productPrice: "", //商品价格
        reserveType: "", //预订金方式 0：全款预订 1：预定金预订
        reservePrice: "", //预定金额
        discountType: "", //优惠方式  0 : 预订立减  1 : 尾款抵扣
        discountPrice: "", //立减价格或抵扣金额
        attrJson: [], //规格参数
        sevenReturn: "0", //七天无理由退货 0 : 否  1 : 是
        freeShipping: "1", //包邮  0 : 否  1 : 是
        fake: "0", //假一赔四  0 : 否  1 : 是 多个用英文逗号隔开
        productParams: [
          {
            paramKey: "",
            paramValue: ""
          }
        ], //产品参数
        payTime: "", //尾款支付时间
        reserveStartTime: "", //预定开始时间
        reserveEndTime: "", //预定开始时间
        deliveryTime: "", //发货时间
        productImage: "", //产品图（必填）
        detailImage: "" //产品详情图 多个用英文逗号隔开 （必填）
      },
      threesdate: ["2020-06-17 00:00", "2020-07-16 00:00"],
      threesdate_z: ["2020-06-17 00:00", "2020-07-16 00:00"],
      //tag键
      tagArray: [
        {
          dynamicTags: {
            tag: []
          },
          guig: "",
          inputVisible: false,
          currentIndex: -1,
          inputValue: ""
        }
      ],
      // 详情图
      dialogVisible3_x: false,
      dialogImageUrl3_x: "",
      //展示图
      dialogVisible3_z: false,
      dialogImageUrl3_z: "",

      //第四块
      fourtext1: "",
      fourBol1: false,
      fourtext2: "",
      fourBol2: false,
      fourtext3: "",
      fourBol3: false,
      fourtext4: "",
      fourBol4: false,
      fourtext5: "",
      fourBol5: false,
      four: {
        bol: false,
        productName: "",
        types: "",
        address: "",
        genre: "",
        nums: "",
        money: "",
        mode: "1",
        sum: "",
        content: ""
      },
      fourdate: "",
      fourdate2: "",

      //第五块
      abs: 1, //是否为实体商家
      five: {
        activityType: "",
        productName: "", //商品名称
        categoryId: "", //商品分类
        productPrice: "", //产品价格
        integral: "", //积分
        nums: "",
        sevenReturn: "0", //七天无理由退货 0 : 否  1 : 是
        freeShipping: "1", //包邮  0 : 否  1 : 是
        fake: "0", //假一赔四  0 : 否  1 : 是 多个用英文逗号隔开
        productParams: [
          {
            paramKey: "",
            paramValue: ""
          }
        ], //产品参数
        productImage: "", //产品图（必填）
        detailImage: "" //产品详情图 多个用英文逗号隔开 （必填）
      },
      fivedate: ["2020-06-17 00:00", "2020-07-16 00:00"],
      fivedate2: ["2020-06-17 00:00", "2020-07-16 00:00"]
    };
  },
  mounted() {},
  methods: {
    //上传文件多于5张
    handleExceed() {
      this.$message({
        message: "警告，最多上传5张图片",
        type: "warning"
      });
    },
    uploadError() {
      this.$message.error("上传失败");
    },
    uploadSuccess(response, file, fileList) {
      this.files = fileList;
    },
    uploadSuccess_1x(response, file, fileList) {
      this.files1 = fileList;
    },
    uploadSuccess_2z(response, file, fileList) {
      this.files2 = fileList;
    },
    uploadSuccess_2j(response, file, fileList) {
      this.files3 = fileList;
    },
    uploadSuccess_2x(response, file, fileList) {
      this.files4 = fileList;
    },
    uploadSuccess_3z(response, file, fileList) {
      this.files5 = fileList;
    },
    uploadSuccess_3x(response, file, fileList) {
      this.files6 = fileList;
    },
    onRemoveTxt(file, fileList) {
      this.files = fileList;
      this.$message({
        message: "删除成功",
        type: "success"
      });
    },
    onRemoveTxt_1x(file, fileList) {
      this.files1 = fileList;
      this.$message({
        message: "删除成功",
        type: "success"
      });
    },
    onRemoveTxt_2z(file, fileList) {
      this.files2 = fileList;
      this.$message({
        message: "删除成功",
        type: "success"
      });
    },
    onRemoveTxt_2j(file, fileList) {
      this.files3 = fileList;
      this.$message({
        message: "删除成功",
        type: "success"
      });
    },
    onRemoveTxt_2x(file, fileList) {
      this.files4 = fileList;
      this.$message({
        message: "删除成功",
        type: "success"
      });
    },
    onRemoveTxt_3z(file, fileList) {
      this.files5 = fileList;
      this.$message({
        message: "删除成功",
        type: "success"
      });
    },
    onRemoveTxt_3x(file, fileList) {
      this.files6 = fileList;
      this.$message({
        message: "删除成功",
        type: "success"
      });
    },

    //  解决element视图没有更新的问题
    change(e) {
      this.$forceUpdate();
    },

    //第一块
    //提交
    ljcj() {
      //上传图片
      var productImages = [];
      for (var ins = 0; ins < this.files.length; ins++) {
        productImages.push(this.files[ins].url);
      }
      this.ones.productImage = productImages.toString();
      var detailImages = [];
      for (var ins1 = 0; ins1 < this.files1.length; ins1++) {
        detailImages.push(this.files1[ins1].url);
      }
      this.ones.detailImage = detailImages.toString();
      this.ones.activityType = this.activityType;
      this.ones.startTime = this.onedate[0];
      this.ones.endTime = this.onedate[1];
      for (var i = 0; i < this.tagArrayone.length; i++) {
        var ax = { guige: "", guigeValue: [] };
        ax.guige = this.tagArrayone[i].guig;
        ax.guigeValue = this.tagArrayone[i].dynamicTags.tagone;
        this.ones.attrjson.push(ax);
      }
      this.ones.businessId=this.businessId
      let datas = this.ones;
      create_activity(datas).then(res => {
        this.$message({
          message: res.data.msg,
          type: "success"
        });
        if(res.data.code==0){
          this.$router.push("/bu47");
        }
      });
    },
    //重置
    resetForm() {
      this.tagArrayone = "";
      this.onedate = "";
      this.ones = {
        activityType: "",
        productName: "", //商品名称
        categoryId: "", //商品分类
        marketPrice: "", //市场指导价
        productNum: "", //提供体验数量
        startTime: "", //活动开始时间  （必填）
        endTime: "", //活动结束时间  （必填），
        attrjson: [], //规格参数
        productImage: [], //产品图（必填）
        detailImage: "", //产品详情图 多个用英文逗号隔开 （必填）
        applyCondition: {
          //申请条件
          province: "",
          city: "",
          sex: "",
          age: "", //年龄
          occupation: "" //职业
        }
      };
    },
    //叉叉框 截取dy里的数组里的内容
    handleCloseone(tag1, index) {
      this.tagArrayone[index].dynamicTags.tagone.splice(
        this.tagArrayone[index].dynamicTags.tagone.indexOf(tag1),
        1
      );
    },
    //点击+内容事件
    showInputone(index) {
      this.tagArrayone[index].inputVisible = true;
      this.$nextTick(_ => {
        this.$refs[`saveTagInputone`][0].$refs.input.focus();
      });
    },
    // 回车事件
    handleInputConfirmone(index) {
      const inputValue = this.tagArrayone[index].inputValue;
      if (inputValue) {
        this.tagArrayone[index].dynamicTags.tagone.push(inputValue);
      }
      this.tagArrayone[index].inputVisible = false;
      this.tagArrayone[index].currentIndex = -1;
      this.tagArrayone[index].inputValue = "";
    },
    //删除
    deletetagone(index) {
      if (this.tagArrayone.length == 1) {
        this.$message({
          message: "警告,不可删除",
          type: "warning"
        });
      } else {
        this.tagArrayone.splice(index, 1);
      }
    },
    //添加el-tag
    addtagone() {
      var nums = this.tagArrayone.length - 1;
      if (
        this.tagArrayone[nums].guig == "" ||
        this.tagArrayone[nums].guig == undefined
      ) {
        this.$message({
          message: "警告,请先添加规格名称",
          type: "warning"
        });
      } else {
        console.log(1);
        var aa = {
          dynamicTags: {
            tagone: []
          },
          inputVisible: false,
          currentIndex: -1,
          inputValue: ""
        };
        this.tagArrayone.push(aa);
      }
    },
    //上传产品详情图
    onehandleRemove_x(file, fileList) {
      console.log(file, fileList);
    },
    onehandlePictureCardPreview_x(file) {
      this.dialogImageUrl1 = file.url;
      this.dialogVisible1 = true;
    },

    //第二块
    twostj() {
      this.twos.productImage = [];
      for (var ins = 0; ins < this.files2.length; ins++) {
        this.twos.productImage.push(this.files2[ins].url);
      }
      this.twos.prizeImage = [];
      for (var ins1 = 0; ins1 < this.files3.length; ins1++) {
        this.twos.prizeImage.push(this.files3[ins1].url);
      }
      this.twos.detailImage = [];
      for (var ins1 = 0; ins1 < this.files4.length; ins1++) {
        this.twos.detailImage.push(this.files4[ins1].url);
      }
      this.twos.activityType = this.activityType;
      this.twos.startTime = this.twosdate[0];
      this.twos.endTime = this.twosdate[1];
      if (this.twos.guessType == 1) {
        this.guessValue = this.twos_1 + "-" + this.twos_1;
      } else if (this.twos.guessType == 2) {
        this.guessValue =
          this.twos_a +
          "-" +
          this.twos_b +
          "-" +
          this.twos_c +
          "-" +
          this.twos_d +
          "-" +
          this.twos_e +
          "." +
          this.twos_f +
          "-" +
          this.twos_g;
      } else {
        this.guessValue = "";
      }
      create_activity(this.twos).then(res => {
        console.log(res);
      });
    },

    //第三块
    //添加tag
    addtag3() {
      var nums = this.tagArray.length - 1;
      if (this.tagArray[nums].guig == "") {
        this.$message({
          message: "警告,请先添加规格名称",
          type: "warning"
        });
      } else {
        var aa = {
          dynamicTags: {
            tag: []
          },
          inputVisible: false,
          currentIndex: -1,
          inputValue: ""
        };
        this.tagArray.push(aa);
      }
    },
    //删除
    deletetag3(index) {
      if (this.tagArray.length == 1) {
        this.$message({
          message: "警告,不可删除",
          type: "warning"
        });
      } else {
        this.tagArray.splice(index, 1);
      }
    },
    //叉叉框 截取dy里的数组里的内容
    handleClose3(tag1, index) {
      this.tagArray[index].dynamicTags.tag.splice(
        this.tagArray[index].dynamicTags.tag.indexOf(tag1),
        1
      );
    },
    //点击事件
    showInput3(index) {
      this.tagArray[index].inputVisible = true;
      this.$nextTick(_ => {
        this.$refs[`saveTagInput`][0].$refs.input.focus();
      });
    },
    // 回车事件
    handleInputConfirm3(index) {
      const inputValue = this.tagArray[index].inputValue;
      if (inputValue) {
        // console.log(this.tagArray[index].dynamicTags.tag);
        this.tagArray[index].dynamicTags.tag.push(inputValue);
      }
      this.tagArray[index].inputVisible = false;
      this.tagArray[index].currentIndex = -1;
      this.tagArray[index].inputValue = "";
    },
    threesadds() {
      var ax = {
        paramKey: "",
        paramValue: ""
      };
      this.threes.productParams.push(ax);
    },
    //删除参数
    deleteParameter(index) {
      if (this.threes.productParams.length == 1) {
        this.$message({
          message: "警告,不可删除",
          type: "warning"
        });
      } else {
        this.threes.productParams.splice(index, 1);
      }
    },
    //提交
    threestj() {
      this.threes.activityType = this.activityType;
      this.threes.reserveStartTime = this.threesdate[0];
      this.threes.reserveEndTime = this.threesdate[1];
      this.threes.payTime = this.threesdate[0];
      this.threes.productImage = [];
      for (var ins = 0; ins < this.files5.length; ins++) {
        this.threes.productImage.push(this.files5[ins].url);
      }
      this.threes.detailImage = [];
      for (var ins1 = 0; ins1 < this.files6.length; ins1++) {
        this.threes.detailImage.push(this.files6[ins1].url);
      }
      for (var i = 0; i < this.tagArray.length; i++) {
        var ax = { guige: "", guigeValue: [] };
        ax.guige = this.tagArray[i].guig;
        ax.guigeValue = this.tagArray[i].dynamicTags.tag;
        this.threes.attrJson.push(ax);
      }
      let datas = this.threes;
      create_activity(datas)
        .then(res => {
          this.$message({
            message: "添加成功",
            type: "success"
          });
        })
        .catch(err => {
          this.$message.error("添加失败");
        });
    },
    //第四块
    fourtypes() {
      if (this.four.genre == 2) {
        this.four.mode = "1";
      } else if (this.four.genre == 3) {
        this.four.mode = "2";
      }
    },
    fourText(index) {
      if (index == 1) {
          this.fourBol1 = true;
          this.fourtext1 = "【点评要求】";
      } else if (index == 2) {
        this.fourBol2 = true;
        this.fourtext2 = "【分享要求】";
      } else if (index == 3) {
        this.fourBol3 = true;
        this.fourtext3 = "【规则说明】";
      } else if (index == 4) {
        this.fourBol4 = true;
        this.fourtext4 = "【套餐介绍】";
      } else if (index == 5) {
        this.fourBol5 = true;
        this.fourtext5 = "【门店信息】";
      }
    },
    shiqu4(nms){
      if(nms==1&&this.fourtext1==""){
        this.fourBol1=false
      }else if(nms==2&&this.fourtext2==""){
        this.fourBol2=false
      }else if(nms==3&&this.fourtext3==""){
        this.fourBol3=false
      }else if(nms==4&&this.fourtext4==""){
        this.fourBol4=false
      }else if(nms==5&&this.fourtext5==""){
        this.fourBol5=false
      }
    },
    // 第五块
    fivesadds() {
      var ax = {
        paramKey: "",
        paramValue: ""
      };
      this.five.productParams.push(ax);
    },
    //删除参数
    deleteParameter5(index) {
      if (this.five.productParams.length == 1) {
        this.$message({
          message: "警告,不可删除",
          type: "warning"
        });
      } else {
        this.five.productParams.splice(index, 1);
      }
    },
    //tab换
    handleClick(tab, event) {
      // console.log(tab, event);
    }
  }
};
</script>
<style scoped>
.el-tag + .el-tag {
  margin-left: 10px;
}
.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
.input-new-tag {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}

.app /deep/ .ist_l .ist_c li:nth-child(1) {
  background-color: #ff9381;
  width: 126px;
  height: 50px;
  display: block;
}
.conres /deep/ .el-tabs__nav {
  margin-left: 175px;
}
.conres /deep/ .el-tabs__item.is-active {
  color: #f06048;
}
.conres /deep/ .el-tabs__active-bar {
  color: #f06048;
}
.conres /deep/ .el-tabs__item:hover {
  color: #f06048;
}
.conres /deep/ .el-tabs__active-bar {
  background-color: #f06048;
}
.back {
  background-color: #f06048;
}
.pxes {
  height: 15px;
}
.back .con {
  width: 1200px;
  margin: 0 auto;
  background-color: #eee;
}
.listneo {
  width: 1161px;
  margin: 0px auto;
  display: flex;
  justify-content: space-between;
}
.conres {
  width: 902px;
  border-radius: 6px;
  background-color: #fff;
}
.conres .ra {
  font-size: 20px;
  color: #313131;
  margin-top: 15px;
  margin-bottom: 20px;
}
.conres .ra h3 {
  font-size: 20px;
  color: #f06048;
  padding-left: 14px;
}
.conres h4 {
  font-family: SourceHanSansCN-Bold;
  font-size: 20px;
  font-weight: 550;
  font-stretch: normal;
  line-height: 24px;
  letter-spacing: 0px;
  color: #313131;
  text-align: center;
} 
.conres form {
  width: 720px;
  margin-top: 35px;
}
.fourContent {
  min-height: 100px;
  border: solid 1px rgb(220, 220, 220);
}
.fourContent /deep/ .el-textarea__inner {
  border: none;
}
</style>